package cn.zl.web.dto.dashboard;

import cn.yunbamboos.rest.service.dto.Data;
import cn.yunbamboos.rest.service.dto.out.GenericOutDTO;
import cn.zl.common.manage.dashboard.CPUDashboard;
import cn.zl.common.manage.dashboard.DiskDashboard;
import cn.zl.common.manage.dashboard.MemoryDashboard;
import cn.zl.common.manage.dashboard.NetworkDashboard;

public class DashboardInfoOutDTO extends GenericOutDTO {

    private final CPUDashboard cpu;
    // 内存
    private final MemoryDashboard memory;
    // 磁盘
    private final DiskDashboard disk;
    // 网络
    private final NetworkDashboard network;

    public DashboardInfoOutDTO(CPUDashboard cpu, MemoryDashboard memory, DiskDashboard disk, NetworkDashboard network) {
        this.cpu = cpu;
        this.memory = memory;
        this.disk = disk;
        this.network = network;
    }

    @Override
    public void encode(Data data) {
        super.encode(data);
        data.set("cpu", cpu.encode());
        data.set("memory", memory.encode());
        data.set("disk", disk.encode());
        data.set("network", network.encode());
    }
}
